package com.appwoo.android.util;

import android.util.Xml;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.HttpURLConnection;
import java.net.URL;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class PullIO
{
  public static XmlPullParser getPullByString(String paramString)
    throws IOException, XmlPullParserException
  {
    if ("<?xml version=\"1.0\" encoding=\"utf-8\" ?>".indexOf("<?xml version=\"1.0\" encoding=\"utf-8\" ?>") == -1)
      paramString = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + paramString;
    InputStreamReader localInputStreamReader = new InputStreamReader(new ByteArrayInputStream(paramString.getBytes()), "UTF-8");
    XmlPullParser localXmlPullParser = Xml.newPullParser();
    localXmlPullParser.setInput(localInputStreamReader);
    return localXmlPullParser;
  }

  public static XmlPullParser getPullByURI(String paramString)
    throws IOException, XmlPullParserException
  {
    XmlPullParser localXmlPullParser = Xml.newPullParser();
    localXmlPullParser.setInput(getReaderByURI(paramString));
    return localXmlPullParser;
  }

  public static Reader getReaderByURI(String paramString)
    throws IOException
  {
    HttpURLConnection localHttpURLConnection = (HttpURLConnection)new URL(paramString).openConnection();
    localHttpURLConnection.setConnectTimeout(2000);
    localHttpURLConnection.setReadTimeout(3000);
    return new InputStreamReader(localHttpURLConnection.getInputStream(), "UTF-8");
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.android.util.PullIO
 * JD-Core Version:    0.6.2
 */